package org.patto.main.container;

import java.util.concurrent.LinkedBlockingDeque;

/**
 * @author songchuanfu
 * @ClassName MayiktLogContainer
 * @qq 1802284273
 * @addres 1802284273@qq.com
 * @微信: wx-suagcf
 */
public class MayiktLogContainer {
    /**
     * linkedBlockingDeque 队列 容器  默认是无界
     */
    private static LinkedBlockingDeque<AsynLogWrapper> asynLogWrapperDeque = new LinkedBlockingDeque<AsynLogWrapper>();

    /**
     * 存入包装对象
     *
     * @param asynLogWrapper
     */
    public static void addLog(AsynLogWrapper asynLogWrapper) {
        asynLogWrapperDeque.offer(asynLogWrapper);
    }

    /**
     * 返回 队列
     *
     * @return
     */
    public static LinkedBlockingDeque<AsynLogWrapper> getAsynLogWrapperDeque() {
        return asynLogWrapperDeque;
    }

//    public static void main(String[] args) {
//        linkedBlockingDeque.offer("mayikt1");//mayikt
//        linkedBlockingDeque.offer("mayikt2");//mayikt
//        System.out.println(linkedBlockingDeque.poll());//mayikt1
//        System.out.println(linkedBlockingDeque.poll());//mayikt2
//        System.out.println(linkedBlockingDeque.poll());//null// 取出成功之后 会从队列中删除它
//    }
}
